<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>麦知网——学问有余，可为人师</title>

<!-- Bootstrap core CSS -->
<link href="../../css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="../../css/non-responsive.css" rel="stylesheet">
<link href="../../css/font-awesome.min.css" rel="stylesheet">
<link href="../../css/sco.message.css" rel="stylesheet">
<link href="../../css/scojs.css" rel="stylesheet">  
    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../../../../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="http://cdn.bootcss.com/html5shiv/3.7.0/html5shiv.min.js"></script>
      <script src="http://cdn.bootcss.com/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
<link href="../../css/manageReward.css" rel="stylesheet">    

</head>
<body>
	{% include 'public/common/header.html' %}
<div class="container" style="margin-top:45px">
		<div class="row">
			<div class="col-xs-12">
				<div>
					<div class="tab_left pull-left">
						<ul class="nav nav-tabs">
						  <li class="active"><a href="#online" data-toggle="tab">我发布的</a></li>
						  <li><a href="#hunt" data-toggle="tab">已揭悬赏</a></li>
						</ul>
					</div>
					
					<div class="clearfix"></div>
				</div>
<!-- Tab panes -->
				<div class="tab-content">
<!-- 我发布的未过期悬赏 标签第一签 -->
					<div class="tab-pane active" id="online">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="th1">悬赏</th>
									<th class="th2">状态</th>
									<th class="th3">留言数/揭榜数</th>
									<th class="th4">过期时间</th>
									<th class="th5">操作</th>
								</tr>
							</thead>
							<tbody>
<!-- 我发布的未过期悬赏  一条悬赏循环开始处 -->
							{% for i in reward %}
								<tr id="reward{{i.4}}">
									<td class="td1">
										<div class="td_12"><a href="{% url 'rewards:thereward' i.4 %}" title="{{i.0}}" target="_blank">{{i.0}}</a></div>
									</td>
									<td>
<!-- 未成交的  -->
									{% ifequal i.5 0 %}
										<div class="td_text" id="mode{{i.4}}">未成交</div>
									{% endifequal %}
<!-- 已成交的 -->
									{% ifequal i.5 1 %}
										<div class="td_text">已成交</div>
									{% endifequal %}
<!-- 制作中 -->
									{% ifequal i.5 2 %}
										<div class="td_text">制作中</div>
									{% endifequal %}
									</td>
									<td><div class="td_text">{{i.1}}/{{i.2}}</div></td>
									<td><div class="td_text">{{i.3|date:"Y-m-d H:i:s"}}</div></td>
									<td>
										<div class="td_text">
											<span class="td_a"><a href="{% url 'rewards:thereward' i.4 %}">查看</a></span>
											{% ifequal i.5 0 %}
											<span class="td_a" id="select{{i.4}}"><a class="selectPartner" href="javascript:void(0)" data-toggle="popover" data-placement="bottom" data-content="<div><!-- 一个揭榜者 开始循环处 -->{% if i.6 %}{% for u in i.6 %}<span class='partner pull-left'><input type='radio' name='select' value='{{u.2}}' /> {{u.1}}</span>{% endfor %}<!-- 一个揭榜者 结束循环处 -->{% else %}暂无揭榜者{% endif %}</div><div><a href='javascript:void(0)' onclick='select({{i.4}})'>确认</a></div>" data-original-title title>选择合作伙伴</a></span>
											{% endifequal %}
											{% ifequal i.5 0 %}
											<span class="td_a"><a href="javascript:void(0)" onclick="det({{i.4}},1)">删除</a></span>
											{% endifequal %}
										</div>
									</td>
								</tr>
							{% endfor %}
<!-- 我发布的未过期悬赏  一条悬赏循环结束处 -->
							</tbody>
						</table>
					</div>
<!-- 我发布的未过期悬赏 标签第2签 -->
					<div class="tab-pane" id="hunt">
						<table class="table table-hover">
							<thead>
								<tr>
									<th class="tth1">悬赏</th>
									<th class="tth2">状态</th>
									<th class="tth3">留言数/揭榜数</th>
									<th class="tth4">交易对象</th>
									<!--<th class="tth5">操作</th>-->
								</tr>
							</thead>
							<tbody>
<!-- 我发布的已过期悬赏  一条悬赏循环开始处 -->
							{% for j in uncover %}
								<tr id="uncover{{j.3}}">
									<td class="td1">
										<div class="td_12"><a href="{% url 'rewards:thereward' j.3 %}" title="{{j.0}}" target="_blank">{{j.0}}</a></div>
									</td>
									<td>
<!-- 未付款的  -->
									{% ifequal j.4 1 %}
										<div class="td_text">制作中</div>
									{% endifequal %}
<!-- 已付款的 -->
									{% ifequal j.4 2 %}
										<div class="td_text">已付款</div>
									{% endifequal %}
<!-- 未成交 的 -->
									{% ifequal j.4 0 %}
										<div class="td_text">未成交</div>
									{% endifequal %}
									</td>
									<td><div class="td_text">{{j.1}}/{{j.2}}</div></td>
									<td><div class="td_text"><span>{{j.5}}</span><span class="mes"><a href="javascript:void(0)" data-toggle="modal" data-target="#myModal{{j.3}}" title="向{{j.5}}发私信"><span class="glyphicon glyphicon-envelope"></span></a></span></div></td>

									<div class="modal fade" id="myModal{{j.3}}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
									  <div class="modal-dialog">
									    <div class="modal-content">
									      <div class="modal-header">
									        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
									        <h4 class="modal-title">发送私信给{{j.5}}</h4>
									      </div>
									      <div class="modal-body">
									        <textarea class="form-control" id="message{{j.3}}" style="height:120px"></textarea>
									      </div>
									      <div class="modal-footer">
									      	<span id='messageresult{{j.3}}'></span>
									        <button type="button" onclick="connected({{j.3}})" class="btn btn-primary">发送</button>
									      </div>
									    </div><!-- /.modal-content -->
									  </div><!-- /.modal-dialog -->
									</div><!-- /.modal -->
									<!--<td>
										<div class="td_text">
											<span class="td_a"><a href="javascript:void(0)" onclick="det({{j.3}},2)">删除</a></span>
										</div>
									</td>-->
								</tr>
							{% endfor %}
<!-- 我发布的已过期悬赏  一条悬赏循环结束处 -->
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
</div>
	
	
	
	
 	<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
	<script src="../../js/jquery.min.js"></script>
	<script src="../../js/logout.js"></script>
	<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
	<script src="../../js/bootstrap.js"></script>
	<script src="../../js/manage.js"></script>
	<script src="../../js/sco.message.js"></script>
	<script src="../../js/message.js"></script>
	<script type="text/javascript">
		$('.selectPartner').popover({html:true});
	</script>
</body>
</html>